package com.gitee.cirnochat.chat.model.vo.resp;
import com.gitee.cirnochat.chat.model.dto.ChatMessage;
import com.gitee.cirnochat.chat.model.enums.ChatSessionType;
import com.gitee.cirnochat.chat.model.enums.MessageOperation;
import com.gitee.cirnochat.chat.model.vo.req.ChatMessageSendRequest;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.springframework.beans.BeanUtils;

@EqualsAndHashCode(callSuper = true)
@Data
@Schema(description = "消息响应对象")
@AllArgsConstructor
@NoArgsConstructor
public class ChatMessageResponse extends ChatMessage {
    /**
     * 消息操作
     */
    @Schema(description = "消息操作类型")
    private MessageOperation operation;
    /**
     * 会话类型
     */
    @Schema(description = "会话类型 0单聊 1群聊")
    private ChatSessionType sessionType;


    public ChatMessageResponse(ChatMessageSendRequest request) {
        BeanUtils.copyProperties(request, this);
    }

}
